<form method="post" action="" name="parent">
<input type="hidden" name="this_category" value="<?php echo $_GET['category'] ?>">
parent:
<select name="category_parent" onchange="document.parent.submit()">
<option>none</option>
<?php
$thiscategory = $_GET['category'];
foreach($db->categories->category as $category) {
  if($thiscategory == $category['name']) {
    $thisparent = $category['parent'];
  }
}
foreach($db->categories->category as $category) {
  $categoryname = $category['name'];
  if($categoryname == $thisparent) {
    echo "<option selected='selected'>$categoryname</option>\n";
  } else {
    echo "<option>$categoryname</option>\n";
  }
}
?>
</select>
</form>
<ul>
<?php
foreach($db->pages->page as $page) {
  $pagetitle = $page['title'];
  foreach(split(" ",$page['categories']) as $category) {
    if($category == $_GET['category']) {
      echo "<li>";
      echo "<a href='?show=$pagetitle'>$pagetitle</a>";
      echo "</li>";
    }
  }
}
?>
</ul>